# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: db\tables\licenses.py
from sqlalchemy import *
from sqlalchemy.orm import mapper
from sqlalchemy.dialects.postgresql import JSONB as TYPE_JSONB
from db.tables import metadata


class LicenseStatus:
    NULL = None
    OK = "ok"
    INVALID_PC = "invalid product code"
    NOT_ACTIVATED = "not activated"
    EXPIRED = "expired"
    UNAUTHORIZED = "unauthorized"
    NOT_FOUND = "not found"
    NO_MAIN_MODULE = "no main module"
    EXPIRY_PROBLEM = "expiry problem"


LicensesTable = Table(
    "licenses",
    metadata,
    Column("license_key", TEXT, primary_key=True),
    Column("status", TEXT),
    Column("expires", DateTime(true)),
    Column("validity_start", DateTime(true)),
    Column("product_code", TEXT),
    Column("licenses", Integer),
    Column("data", TYPE_JSONB),
    Column("last_refresh", DateTime(true)),
    Column("first_activated", DateTime(true)),
)


class LicenseRow(object):
    license_key = None
    status = None
    expires = None
    validity_start = None
    product_code = None
    licenses = None
    data = None
    last_refresh = None
    first_activated = None

    def __init__(self, license_key):
        self.license_key = license_key

    def __str__(self):
        return "R_license[%s]" % (self.license_key,)

    def __repr__(self):
        return self.__str__()


mapper(LicenseRow, LicensesTable)
